<!DOCTYPE html>
<!--导入thymeleaf的名称空间-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <!--th:text 为 Thymeleaf 属性，用于获取指定属性的值-->
    <h1 th:text="'欢迎来到'+${name}"></h1>

    <!--th:insert 片段名引入-->
    <div th:insert="commons::fragment-name"></div>
    <!--th:insert id 选择器引入-->
    <div th:insert="commons::#fragment-id"></div>
    ------------------------------------------------
    <!--th:replace 片段名引入-->
    <div th:replace="commons::fragment-name"></div>
    <!--th:replace id 选择器引入-->
    <div th:replace="commons::#fragment-id"></div>
    ------------------------------------------------
    <!--th:include 片段名引入-->
    <div th:include="commons::fragment-name"></div>
    <!--th:include id 选择器引入-->
    <div th:include="commons::#fragment-id"></div>

    ------------------------------------------------
    <!--th:insert 片段名引入-->
    <div th:insert="commons::fragment2-name(var1='insert-name',var2='insert-name2')"></div>
    <!--th:insert id 选择器引入-->
    <div th:insert="commons::#fragment2-id(var1='insert-id',var2='insert-id2')"></div>

</body>
</html>